home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 1.0 for Developers / QuickTime 1.0 for Developers.iso / Programming Stuff / Interfaces / Movies Interfaces / Components.a next >
Text File  |  1991-09-11  |  16KB  |  290 lines

  1.  
  2. ; Created: Wednesday, August 14, 1991 9:33 AM
  3. ;
  4. ; File: Components.a
  5. ;
  6. ; Assembler Interface to the Macintosh Libraries
  7. ; Copyright Apple Computer, Inc. 1990-1991
  8. ; All Rights Reserved
  9. ;
  10. ;___________________________________________________________________________
  11.  IF &TYPE('__IncludingComponents__') = 'UNDEFINED' THEN
  12. __IncludingComponents__   SET 1
  13.  
  14. gestaltComponentMgr                               EQU      'cpnt'
  15.  
  16. kSmallestArray                                    EQU      1
  17. kFix1                                             EQU      $00010000
  18.  
  19. ComponentDescription                              RECORD   0
  20. componentType                                     DS.L       1                       ; A unique 4-byte code indentifying the command set 
  21. componentSubType                                  DS.L       1                       ; Particular flavor of this instance 
  22. componentManufacturer                             DS.L       1                       ; Vendor indentification 
  23. componentFlags                                    DS.L       1                       ; 8 each for Component,Type,SubType,Manuf/revision 
  24. componentFlagsMask                                DS.L       1                       ; Mask for specifying which flags to consider in search, zero during registration 
  25. size                                              EQU      *
  26.                                                   ENDR
  27.  
  28. ResourceSpec                                      RECORD   0
  29. resType                                           DS.L       1                         ; 4-byte code  
  30. resId                                             DS.W       1
  31. size                                              EQU      *
  32.                                                   ENDR
  33.  
  34. ComponentResource                                 RECORD   0
  35. cd                                                DS       ComponentDescription     ; Registration parameters 
  36. component                                         DS       ResourceSpec             ; resource where Component code is found 
  37. componentName                                     DS       ResourceSpec             ; name string resource 
  38. componentInfo                                     DS       ResourceSpec             ; info string resource 
  39. componentIcon                                     DS       ResourceSpec             ; icon resource 
  40. size                                              EQU      *
  41.                                                   ENDR
  42.  
  43. ; Structure received by Component:  
  44. ComponentParameters                               RECORD   0
  45. flags                                             DS.B     1                           ; call modifiers: sync/async, deferred, immed, etc 
  46. paramSize                                         DS.B     1                           ; size in bytes of actual parameters passed to this call 
  47. what                                              DS.W       1                        ; routine selector, negative for Component management calls 
  48. params                                            DS.L     1                        ; actual parameters for the indicated routine 
  49. size                                              EQU      *
  50.                                                   ENDR
  51.  
  52.  
  53.  
  54. ;*******************************************************
  55. ;*                                                     *
  56. ;*              APPLICATION LEVEL CALLS                *
  57. ;*                                                     *
  58. ;*******************************************************
  59. ;* Component Database Add, Delete, and Query Routines 
  60. ;*******************************************************
  61.                                                   MACRO
  62.                                                   _RegisterComponent
  63.                                                   MOVEQ        #$01,D0
  64.                                                   DC.W         $A82A      ; TB 002A
  65.                                                   ENDM
  66.  
  67.                                                   MACRO
  68.                                                   _RegisterComponentResource
  69.                                                   MOVEQ        #$12,D0
  70.                                                   DC.W         $A82A      ; TB 002A
  71.                                                   ENDM
  72.  
  73.                                                   MACRO
  74.                                                   _UnregisterComponent
  75.                                                   MOVEQ        #$02,D0
  76.                                                   DC.W         $A82A      ; TB 002A
  77.                                                   ENDM
  78.  
  79.  
  80.                                                   MACRO
  81.                                                   _FindNextComponent
  82.                                                   MOVEQ        #$04,D0
  83.                                                   DC.W         $A82A      ; TB 002A
  84.                                                   ENDM
  85.  
  86.                                                   MACRO
  87.                                                   _CountComponents
  88.                                                   MOVEQ        #$03,D0
  89.                                                   DC.W         $A82A      ; TB 002A
  90.                                                   ENDM
  91.  
  92.  
  93.                                                   MACRO
  94.                                                   _GetComponentInfo
  95.                                                   MOVEQ        #$05,D0
  96.                                                   DC.W         $A82A      ; TB 002A
  97.                                                   ENDM
  98.  
  99.                                                   MACRO
  100.                                                   _GetComponentListModSeed
  101.                                                   MOVEQ        #$06,D0
  102.                                                   DC.W         $A82A      ; TB 002A
  103.                                                   ENDM
  104.  
  105.  
  106. ;*******************************************************
  107. ;* Component Instance Allocation and dispatch routines 
  108. ;*******************************************************
  109.                                                   MACRO
  110.                                                   _OpenComponent
  111.                                                   MOVEQ        #$07,D0
  112.                                                   DC.W         $A82A      ; TB 002A
  113.                                                   ENDM
  114.  
  115.                                                   MACRO
  116.                                                   _CloseComponent
  117.                                                   MOVEQ        #$08,D0
  118.                                                   DC.W         $A82A      ; TB 002A
  119.                                                   ENDM
  120.  
  121.  
  122.                                                   MACRO
  123.                                                   _GetComponentInstanceError
  124.                                                   MOVEQ        #$0A,D0
  125.                                                   DC.W         $A82A      ; TB 002A
  126.                                                   ENDM
  127.  
  128.  
  129. ; direct calls to the Components 
  130.                                                   MACRO
  131.                                                   _ComponentFunctionImplemented
  132.                                                   MOVE.L       #$0002FFFD,-(A7)
  133.                                                   MOVEQ        #$00,D0
  134.                                                   DC.W         $A82A      ; TB 002A
  135.                                                   ENDM
  136.  
  137.                                                   MACRO
  138.                                                   _GetComponentVersion
  139.                                                   MOVE.L       #$0000FFFC,-(A7)
  140.                                                   MOVEQ        #$00,D0
  141.                                                   DC.W         $A82A      ; TB 002A
  142.                                                   ENDM
  143.  
  144. ;****************************************************
  145. ;*                                                    *
  146. ;*               CALLS MADE BY Components             *
  147. ;*                                                    *
  148. ;******************************************************
  149. ;******************************************************
  150. ;* Required Component routines
  151. ;******************************************************
  152. kComponentOpenSelect                              EQU      -1                       ; ComponentInstance for this open 
  153. kComponentCloseSelect                             EQU      -2                       ; ComponentInstance for this close 
  154. kComponentCanDoSelect                             EQU      -3                       ; selector # being queried 
  155. kComponentVersionSelect                           EQU      -4                       ; no params 
  156. kComponentRegisterSelect                          EQU      -5                       ; no params 
  157. kComponentTargetSelect                            EQU      -6                       ; ComponentInstance for top of call chain 
  158.  
  159. ;*******************************************************
  160. ;* Component Management routines
  161. ;*******************************************************
  162.                                                   MACRO
  163.                                                   _SetComponentInstanceError
  164.                                                   MOVEQ        #$0B,D0
  165.                                                   DC.W         $A82A      ; TB 002A
  166.                                                   ENDM
  167.  
  168.  
  169.                                                   MACRO
  170.                                                   _GetComponentRefcon
  171.                                                   MOVEQ        #$10,D0
  172.                                                   DC.W         $A82A      ; TB 002A
  173.                                                   ENDM
  174.  
  175.                                                   MACRO
  176.                                                   _SetComponentRefcon
  177.                                                   MOVEQ        #$11,D0
  178.                                                   DC.W         $A82A      ; TB 002A
  179.                                                   ENDM
  180.  
  181.  
  182.                                                   MACRO
  183.                                                   _OpenComponentResFile
  184.                                                   MOVEQ        #$15,D0
  185.                                                   DC.W         $A82A      ; TB 002A
  186.                                                   ENDM
  187.  
  188.                                                   MACRO
  189.                                                   _CloseComponentResFile
  190.                                                   MOVEQ        #$18,D0
  191.                                                   DC.W         $A82A      ; TB 002A
  192.                                                   ENDM
  193.  
  194.  
  195. ;*******************************************************
  196. ;* Component Instance Management routines
  197. ;*******************************************************
  198.                                                   MACRO
  199.                                                   _GetComponentInstanceStorage
  200.                                                   MOVEQ        #$0C,D0
  201.                                                   DC.W         $A82A      ; TB 002A
  202.                                                   ENDM
  203.  
  204.                                                   MACRO
  205.                                                   _SetComponentInstanceStorage
  206.                                                   MOVEQ        #$0D,D0
  207.                                                   DC.W         $A82A      ; TB 002A
  208.                                                   ENDM
  209.  
  210.  
  211.                                                   MACRO
  212.                                                   _GetComponentInstanceA5
  213.                                                   MOVEQ        #$0E,D0
  214.                                                   DC.W         $A82A      ; TB 002A
  215.                                                   ENDM
  216.  
  217.                                                   MACRO
  218.                                                   _SetComponentInstanceA5
  219.                                                   MOVEQ        #$0F,D0
  220.                                                   DC.W         $A82A      ; TB 002A
  221.                                                   ENDM
  222.  
  223.  
  224.                                                   MACRO
  225.                                                   _CountComponentInstances
  226.                                                   MOVEQ        #$13,D0
  227.                                                   DC.W         $A82A      ; TB 002A
  228.                                                   ENDM
  229.  
  230.  
  231.                                                   MACRO
  232.                                                   _FindNextCommonComponentInstance
  233.                                                   MOVEQ        #$14,D0
  234.                                                   DC.W         $A82A      ; TB 002A
  235.                                                   ENDM
  236.  
  237.  
  238. ; useful helper routines for convenient method dispatching 
  239.                                                   MACRO
  240.                                                   _CallComponentFunction
  241.                                                   MOVEQ        #$FF,D0
  242.                                                   DC.W         $A82A      ; TB 002A
  243.                                                   ENDM
  244.  
  245.                                                   MACRO
  246.                                                   _CallComponentFunctionWithStorage
  247.                                                   MOVEQ        #$FF,D0
  248.                                                   DC.W         $A82A      ; TB 002A
  249.                                                   ENDM
  250.  
  251.                                                   MACRO
  252.                                                   _DelegateComponentCall
  253.                                                   MOVEQ        #$24,D0
  254.                                                   DC.W         $A82A      ; TB 002A
  255.                                                   ENDM
  256.  
  257. ; Set Default Component flags 
  258. defaultComponentIdentical                         EQU      0
  259. defaultComponentAnyFlags                          EQU      1
  260. defaultComponentAnyManufacturer                   EQU      2
  261. defaultComponentAnySubType                        EQU      4
  262. defaultComponentAnyFlagsAnyManufacturer           EQU      defaultComponentAnyFlags+defaultComponentAnyManufacturer
  263. defaultComponentAnyFlagsAnyManufacturerAnySubType EQU      defaultComponentAnyFlags+defaultComponentAnyManufacturer+defaultComponentAnySubType
  264.  
  265.                                                   MACRO
  266.                                                   _SetDefaultComponent
  267.                                                   MOVEQ        #$1E,D0
  268.                                                   DC.W         $A82A      ; TB 002A
  269.                                                   ENDM
  270.  
  271.                                                   MACRO
  272.                                                   _OpenDefaultComponent
  273.                                                   MOVEQ        #$21,D0
  274.                                                   DC.W         $A82A      ; TB 002A
  275.                                                   ENDM
  276.  
  277.                                                   MACRO
  278.                                                   _CaptureComponent
  279.                                                   MOVEQ        #$1C,D0
  280.                                                   DC.W         $A82A      ; TB 002A
  281.                                                   ENDM
  282.  
  283.                                                   MACRO
  284.                                                   _UncaptureComponent
  285.                                                   MOVEQ        #$1D,D0
  286.                                                   DC.W         $A82A      ; TB 002A
  287.                                                   ENDM
  288.  
  289.  
  290.                                                   ENDIF    ;   ...already included